namespace Hont
{
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.Networking;

    public struct WebAsyncResponseContext : IDisposable
    {
        public UnityWebRequest.Result Result;

        public UnityWebRequest WebRequest;

        
        public string GetString()
        {
            return WebRequest.downloadHandler.text;
        }

        public Texture GetTexture()
        {
            return DownloadHandlerTexture.GetContent(WebRequest);
        }

        public void Dispose()
        {
            WebRequest?.Dispose();
        }
    }
}
